import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { StatisticalReportComponent } from './statistical-report.component';
import { LockUseComponent } from './lock-use/lock-use.component';
import { LockDistributionComponent } from './lock-distribution/lock-distribution.component';
import { LockBusinessComponent } from './lock-business/lock-business.component';
import { PathUseComponent } from './path-use/path-use.component';
import { PathSecurityComponent } from './path-security/path-security.component';
import { PathAlarmComponent } from './path-alarm/path-alarm.component';
import { PathTimeComponent } from './path-time/path-time.component';
import { AppRouteGuard } from '@shared/common/auth/auth-route-app-guard';

const routes: Routes = [

  {
    path: 'lock',
    canActivate: [AppRouteGuard],
    canActivateChild: [AppRouteGuard],
    component: StatisticalReportComponent,
    data: { breadcrumb_no_url: 'query_statistics' },
    children: [
      {
        path: 'lockUse',
        component: LockUseComponent,
        data: { permission: 'A9_B26_', activeMenu: 'lock', tabBelong: 'lock', breadcrumb: 'lock_use_time_statistics' }
      },
      {
        path: 'lockDistribution',
        component: LockDistributionComponent,
        data: { permission: 'A9_B26_', activeMenu: 'lock', tabBelong: 'lock', breadcrumb: 'lock_use_time_statistics' }
      },
      {
        path: 'lockBusiness',
        component: LockBusinessComponent,
        data: { permission: 'A9_B26_', activeMenu: 'lock', tabBelong: 'lock', breadcrumb: 'lock_use_time_statistics' }
      },
    ],
  },
  {
    path: 'pathUse',
    canActivate: [AppRouteGuard],
    canActivateChild: [AppRouteGuard],
    component: StatisticalReportComponent,
    data: { breadcrumb_no_url: 'query_statistics' },
    children: [
      {
        path: 'pathUse',
        component: PathUseComponent,
        data: { permission: 'A9_B27_', activeMenu: 'pathUse', tabBelong: 'pathUse', breadcrumb: 'path_use_time_statistics' }
      },
      {
        path: 'pathSecurity',
        component: PathSecurityComponent,
        data: { permission: 'A9_B27_', activeMenu: 'pathUse', tabBelong: 'pathUse', breadcrumb: 'path_use_time_statistics' }
      },
      {
        path: 'pathAlarm',
        component: PathAlarmComponent,
        data: { permission: 'A9_B27_', activeMenu: 'pathUse' , tabBelong: 'pathUse', breadcrumb: 'path_use_time_statistics'}
      },
      {
        path: 'pathTime',
        component: PathTimeComponent,
        data: { permission: 'A9_B27_', activeMenu: 'pathUse' , tabBelong: 'pathUse', breadcrumb: 'path_use_time_statistics'}
      },
    ],
  },

];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class StatisticalReportRoutingModule { }
